<html lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
<title>微信支付</title>
<meta name="author" content=""/>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta http-equiv="cleartype" content="on"/>
<script language='javascript'>

    //调用微信JS api 支付
	function jsApiCall()
	{
		var jsApiParameters = <{$jsApiParameters}>;
		var host = '<{$location}>';
		WeixinJSBridge.invoke(
			'getBrandWCPayRequest',
			jsApiParameters,
			function(res){
				WeixinJSBridge.log(res.err_msg);
				//alert(res.err_code+res.err_desc+res.err_msg);
				if(res.err_msg == 'get_brand_wcpay_request:ok'){
				  location.href=host;
				}
			}
		);
	}

	function callpay()
	{
		if (typeof WeixinJSBridge == "undefined"){
		    if( document.addEventListener ){
		        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
		    }else if (document.attachEvent){
		        document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
		        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
		    }
		}else{
		    jsApiCall();
		}
	}

	
	window.onload = function(){
		document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
        	WeixinJSBridge.call('hideOptionMenu');
    	});
    	
		if (typeof WeixinJSBridge == "undefined"){
		    if( document.addEventListener ){
		        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
		    }else if (document.attachEvent){
		        document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
		        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
		    }
		}else{
			jsApiCall();
		}
	};
</script>
</head>
<body>

<div id='clicksendpay' onclick='callpay();' style='width:50%;font-size:1.55em;border-radius:5px;padding:10px 0 25px 0;background:rgba(0,0,0,0.7);margin:0 auto;top:50%;margin-top:-90px;position:relative;color:#fff;text-align:center;'>
<h3 style='font-size:16px;'>微信安全支付</h3>
<a style='font-size:12px;display:inline-block;padding:5 20px;height:18px;line-height:18px;text-align:center;margin:0 auto;background:#54da1a;-webkit-border-radius: 5px;'>立即支付</a>
</div>
</body>
</html>